/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.fasepa.sgpf.util;

import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;

/**
 *
 * @author marcosdj
 */
public class SystemUtil {

    public static void updateUseCase(Object obj, Class entityClass) {
        JsfUtil.getSession().setAttribute("UC", new Object[]{entityClass, obj});
    }

    public static void removeAtribute() {
        JsfUtil.getSession().removeAttribute("UC");
    }

    public static String getCanonicalAppPath(String path) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ServletContext scontext = (ServletContext) facesContext.getExternalContext().getContext();

        return scontext.getRealPath(path);
    }
}
